import axios from './axios'

const querystring = require('querystring');

//将object转化为请求格式
function transformParas(path, params) {
    return path + '?' + querystring.stringify(params);
}

export default {
    getBanner(path, params) {
        return axios.get(transformParas(path, params));
    },
    getPersonalized(path, params){
        return axios.get(transformParas(path, params));
    },
    getHotPlaylist(path,params){
        return axios.get(transformParas(path, params));
    },
    getAlbumNewest(params){
        return axios.get(transformParas('/album/newest', params));
    },
    getToplistDetail(params){
        return axios.get(transformParas('/toplist', params));
    },
    getATopList(params){
        return axios.get(transformParas('/top/list',params));
    },
    getMusicUrl(params){
        return axios.get(transformParas('/song/url',params));
    },
    getMusicDetail(params){
        return axios.get(transformParas('/song/detail',params));
    },
    getSearchAdvise(params){
        return axios.get(transformParas('/search/suggest',params));
    }
}



